for i in range(4):
    username = input("请输入用户名：")
    passwd = input("请输入密码：")
    if username == "root" and passwd == "123456":
        print("恭喜！登录成功！")
        break
    else:
        print(f"用户名或密码错误，请重试（您还有{3-i}次机会）")
else:
    print("登录失败！")